import request from '@/utils/request';
import settings from '../../../config/defaultSettings';
export async function GetRoleByPage(params: any) {
  return request(`${settings.prefixUrl}/system/role/getRoleByPage`, {
    method: 'POST',
    data: params,
  });
}

export async function GetPermissionTreeByRole(params: any) {
  return request(`${settings.prefixUrl}/system/role/getPermissionTreeByRole`, {
    method: 'POST',
    data: params,
  });
}

export async function GetPermissionById(params: any) {
  return request(`${settings.prefixUrl}/system/role/getPermissionById`, {
    method: 'POST',
    data: params,
  });
}

export async function addRole(params: any) {
  return request(`${settings.prefixUrl}/system/role/addRole`, {
    method: 'POST',
    data: params,
  });
}

export async function updateRole(params: any) {
  return request(`${settings.prefixUrl}/system/role/updateRole`, {
    method: 'POST',
    data: params,
  });
}

export async function delRole(params: any) {
  return request(`${settings.prefixUrl}/system/role/delRole`, {
    method: 'POST',
    data: params,
  });
}

export async function saveMenus(params: any) {
  return request(`${settings.prefixUrl}/system/role/saveMenus`, {
    method: 'POST',
    data: params,
  });
}
